<template>
  <div class="knowledge-create">
    <div
      class="knowledge-wrap"
      ref="knowledge-wrap"
      :style="{ height: wrapHeight + 'px' }"
    >
      <Create />
    </div>
  </div>
</template>
<script>
export default {
  components: {
    Create: () => import("./create.vue"),
  },
  data() {
    return {
      wrapHeight: 500,
    };
  },
  mounted() {
    setTimeout(() => {
      this.init();
    }, 200);
    window.onresize = () => {
      this.init();
    };
  },
  methods: {
    init() {
      let wHeight = document.body.clientHeight;
      if (!this.$refs["knowledge-wrap"]) return;
      let topDistance =
        this.$refs["knowledge-wrap"].getBoundingClientRect().top;
      this.wrapHeight = wHeight - topDistance - 45;
    },
  },
};
</script>
<style scoped>
.knowledge-create {
  position: relative;
}
.knowledge-create .knowledge-wrap {
  overflow: hidden;
  /* overflow-y: scroll; */
  position: relative;
}
</style>